<template>
    <n-tag :type="getType(props.type)" round>
        {{ name }}
    </n-tag>
</template>

<script lang="ts" setup>
import { NTag } from 'naive-ui'

const props = defineProps<{
    type: number|undefined,
    name: string|undefined,
}>()

function getType(type: number|undefined): "default" | "error" | "primary" | "info" | "success" | "warning" | undefined {
    switch (type) {
        case 0:
            return "error";
        case 1:
            return "info";
        case 2:
            return "warning";
        case 3:
            return "success";
    }
    return "error"
}

</script>

<style></style>